<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="/struts-tags" prefix="s" %>
<!DOCTYPE html>
<html>
<head>
<title>人物信息列表</title>
<style type="text/css">
  table, td {
    border: 1px solid
  }
  
  table {
    border-collapse: collapse;
  }
</style>
</head>
<body>
<div align="center">
    <fieldset>
      <s:form action="personAction!add.action" method="post" style="width: 260px">
        <legend>添加人物信息</legend>
        <s:textfield name="person.personName" label="人物姓名" value="" />
        <s:select name="person.sex" list="#{1:'男',0:'女'}" label="性别" value="" />
        <s:textfield name="person.birthdate" label="出生日期" value="" />
        <s:textfield name="person.address" label="住址" value="" />
        <s:submit value="添加" />
      </s:form>
    </fieldset>
    <table cellpadding="0" width="70%" align="center" style="border: 1px solid;">
    <tr>
      <th>人物id</th>
      <th>人物姓名</th>
      <th>性别</th>
      <th>出生日期</th>
      <th>住址</th>
      <th>操作</th>
    </tr>
    <s:if test="persons!=null&&persons.size>0">
      <s:iterator value="persons" var="obj">
        <tr>
          <td><s:property value="#obj.personId" /></td>
          <td><s:property value="#obj.personName" /></td>
          <td>
            <s:if test="#obj.sex==1">
              <s:property value="'男'" />
            </s:if>
            <s:else>
              <s:property value="'女'" />
            </s:else>
          </td>
          <td><s:property value="#obj.birthdate" /></td>
          <td><s:property value="#obj.address" /></td>
          <td>
            <s:a href="personAction!edit.action?person.personId=%{#obj.personId}">修改</s:a>
            <s:a href="personAction!remove.action?person.personId=%{#obj.personId}">移除</s:a>
          </td>
        </tr>
      </s:iterator>
    </s:if>
  </table>
</div>
</body>
</html>
